home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / lib / multi.pro < prev    next >
Text File  |  1997-07-08  |  2KB  |  92 lines

  1. ; $Id: multi.pro,v 1.3 1997/01/15 03:11:50 ali Exp $
  2. ;
  3. ; Copyright (c) 1984-1997, Research Systems, Inc.  All rights reserved.
  4. ;       Unauthorized reproduction prohibited.
  5.  
  6. pro multi, n    ;Multiple wrap of existing color tables
  7. ;+
  8. ; NAME:
  9. ;    MULTI
  10. ;
  11. ; PURPOSE:
  12. ;    Expand the current color table to wrap around N times.
  13. ;
  14. ; CATEGORY:
  15. ;    Image display.
  16. ;
  17. ; CALLING SEQUENCE:
  18. ;    MULTI, N
  19. ;
  20. ; INPUTS:
  21. ;    N:    The number of times the color table will wrap.  This 
  22. ;        parameter does not need not be an integer.
  23. ;
  24. ; OUTPUTS:
  25. ;    No explicit outputs, color tables are loaded.
  26. ;
  27. ; COMMON BLOCKS:
  28. ;    COLORS, the IDL color table common block, contains current color 
  29. ;    tables, loaded by LOADCT, ADJCT, HLS, HSV, etc.
  30. ;
  31. ; SIDE EFFECTS:
  32. ;    Color tables are loaded.
  33. ;
  34. ; RESTRICTIONS:
  35. ;    One of the above procedures must have been called.
  36. ;
  37. ; PROCEDURE:
  38. ;    Tables are expanded by a factor of n.
  39. ;
  40. ; EXAMPLE:
  41. ;    Display an image, load color table 1, and make that color table
  42. ;    "wrap around" 3 times.  Enter:
  43. ;        TVSCL, DIST(256)    ;A simple image.
  44. ;        LOADCT, 1        ;Load color table 1.
  45. ;        MULTI, 3        ;See how the new color table affects
  46. ;                    ;the image.
  47. ; MODIFICATION HISTORY:
  48. ;    DMS, May, 1984.
  49. ;    Changed common, DMS, 4/87.
  50. ;-
  51. common colors,r,g,b,cur_red,cur_green,cur_blue
  52. on_error,2                      ;Return to caller if an error occurs
  53. if n_params() eq 0 then n = 1    ;Default = 1 wrap
  54. m = n_elements(r)        ;size of tables
  55. if m le 0 then begin
  56.         m = 256        ;Default to 256.
  57.         r=indgen(m)  & g = r  & b = r
  58.         end
  59. mm = (indgen(M)*n) mod m    ;calc subscripts
  60. cur_red = r[mm] & cur_green = g[mm] & cur_blue = b[mm]
  61. tvlct,cur_red,cur_green,cur_blue ;load it
  62. return
  63. end
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.